
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/templates/TCubeStaffTemplate.xhtml">
    <ui:define name="content">
        <h:form id="staffLogin">  
            <!-- this selectedLocale menu must always be at the top of the form -->
            <h:selectOneMenu id="selectedLocale" value="#{indexManagedBean.selectedLocale}">
                <f:selectItems value="#{enumLanguage.listItems}" />

                <p:ajax update="login.header.panel
                                touristLoginUsernameLabel
                                username 
                                touristLoginPasswordLabel 
                                password
                                loginLoginButton
                                panel" 
                        listener="#{indexManagedBean.selectedLocaleValueChangeListener}" />
            </h:selectOneMenu>
            <!-- this end selectedLocale menu must always be at the top of the form -->

            <!-- panel for dividing web page into sections -->
            <p:panel id="panel" header="#{bundle['login.header.panel']}" style="margin-bottom:10px;">  
                <p:messages />

                <h:panelGrid columns="3">
                    <h:outputText id="staffLoginUsernameLabel" value ="#{bundle['login.username.label']}" />
                    <p:inputText id="username" required="true" label="username" requiredMessage="#{bundle['login.username.required']}" value="#{staffLoginManagedBean.username}" />
                    <p:message for="username"/>

                    <h:outputLabel id="staffLoginPasswordLabel" value="#{bundle['login.password.label']}" />
                    <p:password id="password" feedback="false" minLength="6" required="true" label="password" requiredMessage="#{bundle['login.password.required']}" value="#{staffLoginManagedBean.password}" />
                    <p:message for="password"/>
                </h:panelGrid>

                <br></br>
                <h:panelGrid columns="2">
                    <h:selectBooleanCheckbox id="remember_me"/> <h:outputLabel value="Remember me!"/>
                    <br></br><br></br>
                    <h:commandLink value ="Forgot Password?"/>
                </h:panelGrid>

                <p:commandButton id="loginLoginButton" value="#{bundle['login.login.button']}" update="panel" actionListener="#{staffLoginManagedBean.doLogin}"/>
            </p:panel>  
        </h:form>
    </ui:define>
</ui:composition>
